//
//  P2241.hpp
//  suanfa
//
//  Created by 刘锦程 on 2023/7/8.
//

#include<iostream>
using namespace std;
int n,m;
int zf,cf;
void P2241ans(){
    long long sum_sq=0;
    long long sum=0;
    cin>>n>>m;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=m;j++){
            sum_sq+=min(i,j);
            sum+=i*j;
        }
    }
    
    cout<<sum_sq<<" "<<sum-sum_sq<<endl;
    
}
